Skip to content

Conversation

kaushiksrini
Copy link

Which issue does this PR close?

What changes are included in this PR?

  • Adds table_properties.rs to hold and validate properties and set default values. Uses macros to simplify setting new properties.

Are these changes tested?

In the process of adding them.

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kaushiksrini for this pr. Although this is quite interesting, I feel that this design is a little hard to maintain. What I expected is sth like following:

pub struct TableProperties {
   #[key="commit.retry.num-retries"]
   #[default="4"]
   pub commit_num_retries: usize,
   ...
}

impl TryFrom<&HashMap<String, String>>> for TableProperties {
   // parse by entry key or use default value
}

Note we don't have a defult method for TableProperties, since some values don't have default methods. See https://github.com/apache/iceberg/blob/b15f4ac1795d25f9db5aa1559b677d57d1bacceb/core/src/main/java/org/apache/iceberg/TableProperties.java#L25 for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add table_properties.rs to hold all properties

2 participants